import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia';
import piniaPluginPersist from 'pinia-plugin-persist';
// element-plus
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
// v-md-editor
import VueMarkdownEditor from '@kangc/v-md-editor';
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index';
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index';
import Prism from 'prismjs';
// 自定义方法
import direction from '@/utils/directive';



VueMarkdownEditor.use(vuepressTheme, {
  Prism,
});
VueMarkdownEditor.use(createLineNumbertPlugin());
VueMarkdownEditor.use(createCopyCodePlugin());
VMdPreview.use(vuepressTheme, {
  Prism
})
VMdPreview.use(createLineNumbertPlugin());
VMdPreview.use(createCopyCodePlugin());

const app = createApp(App);

const pinia = createPinia();
pinia.use(piniaPluginPersist);

app.use(router);
app.use(pinia);
app.use(ElementPlus);
app.use(VueMarkdownEditor);
app.use(VMdPreview);
app.use(direction);

app.mount('#app')
